home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 July / DPPCPRO0705.ISO / Extras / NetSupport Manager / setup.exe / DRVSIZE.SCP < prev    next >
Encoding:
Text File  |  2004-10-06  |  5.5 KB  |  132 lines

  1. // Author :         Daniel Dickman(NetSupport Ltd) 
  2. // File name :         DrvSize.scp
  3. // Date created :        17/08/00
  4. // Modified :                    Andy Earp 10/09/00
  5. // Description : 
  6. //        This script will perform a browse for all available clients on the network and connect to each Client in turn. It will 
  7. //        then report back information regarding the amount of available space on each drive on the Client machine 
  8. //        including mapped network drives. This script can be used to find out if there is enough space on the required
  9. //        drive on the Client machine to install a application. It is possible to define within the script the size of the 
  10. //        application so the script will report back if there is enough space or not on the drive to install the application. 
  11.  
  12. //        **Note: If there is no Floppy disk in the machine a error 21 reading drive error will occur
  13.  
  14. Print "***************************************************************"
  15. Print " "
  16. Print " This script is firstly going to prompt the user to enter"
  17. Print " partial Client details for the lookup. Next the script"
  18. Print " will connect to each Client in turn and display "
  19. Print " the amount of free space found on each drive"
  20. Wait (7)
  21. Print " "
  22. Print " The script will check if there is more than"
  23. Print " 290Mb of free space available on each drive."
  24.  
  25. Wait (8)
  26. Print " "
  27. Print " **Note: This script will not be able to display  "
  28. Print " the correct drive size of mapped drives for "
  29. Print " NT\W2000 and will report that 0Mb of free space"
  30. Print " is available. To report the correct size enable"
  31. Print " the option to 'Impersonate the current user' in the "
  32. Print " Advanced Client configurator."
  33. Print " "
  34. Wait (8)
  35.  
  36. SetTransport(T_TCPIP)
  37.  
  38. // Declares each variable used within the script
  39. Dim ClientList
  40. Dim Client
  41. Dim Mask
  42. Dim Count
  43.  
  44. Count = 0
  45.  
  46. If input ("Please enter a Client prefix to restrict the number of Clients found or press ok to include all Clients : ", Mask) = false then
  47.     Print " The script has been cancelled and will now stop!"
  48.     Print " *********************************************************"
  49.     Wait (4)
  50.     Stop
  51. Else
  52.     // Performs a browse for available Clients, you can enter partial or complete Client name details within the speech marks 
  53.     Lookup (Mask, ClientList)
  54.  
  55.     // performs the drive space check for each Client found in the lookup
  56.     for each client in clientlist
  57.     
  58.         // Error checks the connection to the Client
  59.         If Connect (Client) = FALSE then 
  60.             Print " Could not connect to the client!"
  61.             Wait (4)
  62.         else
  63.             Print " Connected to client ", CurrentClient (), " okay"
  64.             Wait(3)
  65.  
  66.             // Declares further variables used in this condition
  67.             Dim driveletter
  68.             Dim drivelst
  69.             Dim drivepath
  70.             Dim drivespace2
  71.         
  72.             // Creates a list of all available drives on the machine
  73.             GetDriveList(">",drivelst)
  74.         
  75.             // Performs the below condition for each drive found in the drive list
  76.             for each drive in drivelst
  77.         
  78.                 report_size = 2    // Makes sure that the sizes returned are in Megabytes.
  79.         ;       print " Drive ", drive," is ", DriveSize (">"+ drive)," MB"    //Reports the size of the drive
  80.                 print " "  
  81.                 print " Drive ", drive," has ", DriveSpace(">"+ drive), " MB  free"    // reports the available space on the drive that is free
  82.                 drivepath = DriveSize(">"+drive)
  83.                 drivespace2 = DriveSpace(">"+drive)
  84.                 
  85.                 // Will state if the current drive is empty
  86.                 If drivepath == 0 and drivespace2 ==0 then
  87.                     print " Disk drive is empty "
  88.                     Print "**********************"
  89.                     wait (3)
  90.                 else
  91.         
  92.                     // Will state if the current drive is full
  93.                     if drivepath<>0 and drivespace2 ==0 then
  94.                         print " Drive is full "
  95.                         Print " ************ "
  96.                         Wait (3)
  97.                     else
  98.         
  99.                         // This is were you can change the size of the amount of free space you require, currently set at 290MB
  100.                         if drivespace2 <=290 then       
  101.                             print " Not enough room to install application"
  102.                             Print " ********************************************"
  103.                             wait (3)
  104.                         else
  105.                             Print " There is still room to install."
  106.                             Print " *******************************"
  107.                             Wait (3)
  108.                         endif
  109.                     endif
  110.                 endif
  111.             next
  112.              // Disconnects from the Client machines
  113.             Print " "
  114.             Print " You have disconnected from ", currentClient(),""
  115.             Disconnect(Client)
  116.             Wait(5)
  117.             Count = Count + 1
  118.         endif
  119.     next
  120.     If Count = 0 then 
  121.         Print "There were no available Clients found on the network"
  122.     Else
  123.         Print "The number of Clients found was ", Count
  124.     Endif
  125.     Print "************************************************************"
  126.     Print " "
  127.     Print "To edit or view the contents of this"
  128.     Print "script right mouse button click"
  129.     Print "on the Script icon and select Edit" 
  130.  
  131. endif    
  132. //Copyright ⌐ 2000